﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
	<CodeSnippet Format="1.0.0">
		<Header>
			<Title>initialize</Title>
			<Author>zeroflag</Author>
			<Description></Description>
			<HelpUrl></HelpUrl>
			<SnippetType>SurroundsWith/Expansion</SnippetType>
			<Shortcut>#fk</Shortcut>
			<Keywords>
				<Keyword>foreign key</Keyword>
				<Keyword>fk</Keyword>
			</Keywords>
		</Header>
		<Snippet>
			<References />
			<Imports />
			<Declarations>
				<Literal Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Name</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>Value</Default>
					<Function></Function>
				</Literal>	
				<Literal Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Data</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>fi</Default>
					<Function></Function>
				</Literal>
				<Object Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Type</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>object</Default>
					<Function></Function>
				</Object>
				<Literal Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Documentation</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>//TODO: Add documentation</Default>
					<Function></Function>
				</Literal>
				<Object Editable="false">
					<ID>Class</ID>
					<Function>ClassName()</Function>
				</Object>
				<!--
				<Literal Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Initialization</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>//TODO: Initialize...</Default>
					<Function></Function>
				</Literal>
				-->
			</Declarations>
			<Code Language="CSharp" Delimiter="$">
				<![CDATA[
private $Type$ _$Name$;

/// <summary>
/// The $Type$ this $Class$ belongs to.
/// </summary>
public $Type$ $Name$
{
get
{
	if (_$Name$ == null)
	{
		int? id = this.Data.$Data$;
		if (id != null)
		{
			this._$Name$ = $Type$.Get(id.Value);
		}
	}
	return _$Name$;
}
set
{
	if (_$Name$ != value)
	{
		if (value == null)
		{
			this.Data.$Data$ = null;
		}
		else
		{
			this.Data.$Data$ = value.Id;
		}
		_$Name$ = value;
		this.OnPropertyChanged("$Name$");
	}
}
}
]]>
			</Code>
		</Snippet>
	</CodeSnippet>
</CodeSnippets>